473,465 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Help with dropdownlist validation using javascript

Hello,

Thanks in advance for any help you might be able to offer...

I have an html table with two columns and 10 rows. The first column
contains a textbox that is populated. The second column contains a
drop down box with selectable values from 1-9. This row is repeated
10 times with different text in each rows first column but with the
exact same drop downlist in all rows...to give you a table of 10
elements long and 2 elements wide.

This is where the fun begins...I want to limit the user to only be
able to select the number from the drop down box once. If the user
selected 1 in row 1 then that user cannot select 1 in any of the other
9 rows and so on...am I making myself clear?

I don't necessarily have to have the number disappear from the drop
down list once it is used but it would be nice that if the user has
already selected that value that I could give some kind of an error
messge to them....

I have no idea how to accomplish this...the application is written
using asp.net 2.0 and all objects are generated dynamically when the
page is displayed to the user. Due to application design I don't
believe I can handle a postback event.

I really appreciate any help with this matter.

Thanks,
Scott

Jun 27 '08 #1
1 2140
On Apr 28, 1:28*pm, scott <sdaniel1...@gmail.comwrote:
Hello,

Thanks in advance for any help you might be able to offer...

I have an html table with two columns and 10 rows. *The first column
contains a textbox that is populated. The second column contains a
drop down box with selectable values from 1-9. *This row is repeated
10 times with *different text in each rows first column but with the
exact same drop downlist in all rows...to give you a table of 10
elements long and 2 elements wide.

This is where the fun begins...I want to limit the user to only be
able to select the number from the drop down box once. *If the user
selected 1 in row 1 then that user cannot select 1 in any of the other
9 rows and so on...am I making myself clear?

I don't necessarily have to have the number disappear from the drop
down list once it is used but it would be nice that if the user has
already selected that value that I could give some kind of an error
messge to them....

I have no idea how to accomplish this...the application is written
using asp.net 2.0 and all objects are generated dynamically when the
page is displayed to the user. *Due to application design I don't
believe I can handle a postback event.

I really appreciate any help with this matter.

Thanks,
Scott
Hi Scott,

Why cant you handle a post back event? So you are saying you cannot
add an onselectedindexchange event to the drop down lists? Seems like
that since the page is creatd dynamically, then in the code behind
would be a good place to filter the drop downs based on what has
already been selected.

You could add javascript to achieve the same. You would need to give
each drop down a unique ID in the codehind then, add an onchange event
to the drop downs to go look at what has been used and perform results
accordingly.

hope this helps.
Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ritskits | last post by:
I have the dropdownlist that is populated when the form is loaded. I have the button that opens search child window using the modalwindowdialog and it returns the value that I want to add to the...
7
by: Stephen | last post by:
I have some code which I call from a custom validator however I seem to have got the logic wrong and im having trouble figuring out how to write my code to get things to work the way I require....
2
by: Wes Weems | last post by:
I'd like to have a 3 values in a drop down, and have a validator not allow a form submit unless its 2 of the 3 values (eg, one of the values says "select one") I used custom validator and did a...
1
by: Reddy | last post by:
Hi, My web form has a dropdown list and a textbox server controls. The user must enter some text in the textbox he selects only the last item in the dropdownlist. I tried using a custom...
9
by: Alan Silver | last post by:
Hello, I have some simple client-side Javascript validation that was working fine until now. For some reason (don't ask me), it has stopped working and I can't figure out why. I have switched to...
0
by: Aws | last post by:
My crazy GridView !! I am using Visual Studio 2005, I have a problem with my GridView. I have one access .mdb table and when I update a record on the table EVERYTHING is perfect. I made a Web...
0
by: eurorscg | last post by:
Hi, i have this dropdownlist that breaks xhtml w3c validation.because it generates a select tag with a javascript property. this only happens when autopostback is set to true. so the the...
3
by: Lohboy | last post by:
Using ASP.NET and IE7. (Sorry if I am posting in the wrong forum but my problem seemed to be more related to the JavaScript side than the ASP.NET side.) I have two DropDownList controls the...
2
by: nomad | last post by:
Hi, I have a databound dropdownlist. I have added AppendDataBoundItems="True" so that I am able to enter a item in the dorpdownlist of "-- Please select --". I would like to be able to set it...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.